import request from '@/utils/request'

/** 店铺配置列表查询 */
export function postShopConfigGetAll(data) {
  return request({
    url: '/shopConfig/getAll',
    method: 'post',
    data,
  })
}
/** 修改店铺配置 */
export function postShopConfigUpdate(data) {
  return request({
    url: '/shopConfig/update',
    method: 'post',
    data,
  })
}
/** 添加店铺配置 */
export function postShopConfigSave(data) {
  return request({
    url: '/shopConfig/save',
    method: 'post',
    data,
  })
}
/** 同步店铺配置 */
export function postShopConfigModelSyncData(data) {
  return request({
    url: '/shopConfigModel/syncData',
    method: 'post',
    data,
  })
}
/** 批量修改店铺配置 */
export function postShopConfigUpdateBatch(data) {
  return request({
    url: '/shopConfig/updateBatch',
    method: 'post',
    data,
  })
}
/** 删除店铺配置 */
export function postShopConfigDelete(data) {
  return request({
    url: '/shopConfig/delete',
    method: 'post',
    data,
  })
}
/** 查询单个店铺配置 */
export function postShopConfigGetById(data) {
  return request({
    url: '/shopConfig/getById',
    method: 'post',
    data,
  })
}

/** 字典配置类型下拉数据查询 */
export function getShopConfigGetConfigTypeSelect(params) {
  return request({
    url: '/shopConfigModel/getConfigTypeSelect',
    method: 'get',
    params,
  })
}

/** 字典表单类型下拉数据查询 */
export function getShopConfigGetFormTypeSelect(params) {
  return request({
    url: '/shopConfigModel/getFormTypeSelect',
    method: 'get',
    params,
  })
}

/** 店铺配置模板列表查询 */
export function postShopConfigModelGetAll(data) {
  return request({
    url: '/shopConfigModel/getAll',
    method: 'post',
    data,
  })
}

/** 店铺配置模板列表查询 */
export function postShopConfigModelSave(data) {
  return request({
    url: '/shopConfigModel/save',
    method: 'post',
    data,
  })
}

/** 修改店铺配置模板 */
export function postShopConfigModelUpdate(data) {
  return request({
    url: '/shopConfigModel/update',
    method: 'post',
    data,
  })
}

/** 删除店铺配置模板 */
export function postShopConfigModelDelete(data) {
  return request({
    url: '/shopConfigModel/delete',
    method: 'post',
    data,
  })
}

/** 查询单个店铺配置模板 */
export function postShopConfigModelGetById(data) {
  return request({
    url: '/shopConfigModel/getById',
    method: 'post',
    data,
  })
}

/** 余额列表 */
export function getAccountList(data) {
  return request({
    url: '/account/list',
    method: 'get',
    params: data,
  })
}
/** 经销商下拉列表 */
export function getDealerlList(data) {
  return request({
    url: 'account/dealerList',
    method: 'get',
    params: data,
  })
}

/** 转账 */
export function postAccountTransfer(data) {
  return request({
    url: 'account/transfer',
    method: 'post',
    data,
  })
}
/** 获取充值配置 */
export const getRechargeConfig = (data) => {
  return request({
    url: 'dict/getSelect',
    method: 'post',
    data,
  })
}
// 手动充值确认
export const postRechargeConfirm = (data) => {
  return request({
    url: 'account/rechargeAccount',
    method: 'post',
    data,
  })
}

// ****** 平台支付配置 ******
/**
 * 支付配置列表查询
 */
export function postPayConfigGetAll(data) {
  return request({
    url: '/payConfig/getAll',
    method: 'post',
    data,
  })
}

/**
 * 添加支付配置
 */
export function postPayConfigSave(data) {
  return request({
    url: '/payConfig/save',
    method: 'post',
    data,
  })
}

/**
 * 修改支付配置
 */
export function postPayConfigUpdate(data) {
  return request({
    url: '/payConfig/update',
    method: 'post',
    data,
  })
}

/**
 * 同步店铺配置
 */
export function postPayConfigSyncData(data) {
  return request({
    url: '/payConfig/syncData',
    method: 'post',
    data,
  })
}

/**
 * 同步店铺配置
 */
export function postPayConfigDelete(data) {
  return request({
    url: '/payConfig/delete',
    method: 'post',
    data,
  })
}

/**
 * 查询单个支付配置
 */
export function postPayConfigGetById(data) {
  return request({
    url: '/payConfig/getById',
    method: 'post',
    data,
  })
}

/**
 * 查询单个支付配置
 */
export function getPayConfigGetYmlById(id) {
  return request({
    url: `/payConfig/getYmlById/${id}`,
    method: 'get',
  })
}

/**
 * 查询单个支付配置
 */
export function getPayConfigGetJsonById(id) {
  return request({
    url: `/payConfig/getJsonById/${id}`,
    method: 'get',
  })
}
/**
 * 刷新店铺域名
 */
export function refreshBusinessDomain(data) {
  return request({
    url: `/shop/refreshBusinessDomain`,
    method: 'post',
    data,
  })
}
